using System;
using System.Collections.Generic;
using System.Text;

namespace Efficient.Domain
{
    [Serializable]
    public abstract class ValueType<T> : IComparable<T> where T : class
    {
        public override bool Equals(object other)
        {
            if (this == other)
            {
                return true;
            }
            T entity = other as T;
            if (entity == null)
            {
                return false;
            }
            return BusinessEquals(entity);
        }

        public abstract override int GetHashCode();

        protected abstract bool BusinessEquals(T entity);

        public abstract int CompareTo(T other);


    }
}
